package com.zlt.bkparking.config;

import com.zlt.bkparking.controller.salesman.WebSocketServer;
import com.zlt.bkparking.service.AdvertisementPlayedService;
import com.zlt.bkparking.service.AdvertisingEquipmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

/**
 * @Date: 2022/10/11 15:55
 * @Author: hzj
 * @Description:
 */
@Configuration
public class WebSocketConfig {
    @Bean
    public ServerEndpointExporter serverEndpointExporter() {
        return new ServerEndpointExporter();
    }

    @Autowired
    public void setAdvertisementPlayedService(AdvertisementPlayedService advertisementPlayedService){
        WebSocketServer.advertisementPlayedService= advertisementPlayedService;
    }
    @Autowired
    public void setAdvertisingEquipmentService(AdvertisingEquipmentService advertisingEquipmentService){
        WebSocketServer.advertisingEquipmentService= advertisingEquipmentService;
    }
    @Autowired
    public void setRedisTemplate(RedisTemplate redisTemplate){
        WebSocketServer.redisTemplate= redisTemplate;
    }
}
